package com.hclc.yxb.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hclc.entity.model.enums.AdminStatusEnum;
import com.hclc.entity.model.enums.HiddenEnum;
import com.hclc.entity.model.series.CustomLocalDateTimeSerializer;
import com.hclc.entity.model.series.DeCustomLocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>菜单表</p>
 * @author hef
 * @since 2020-08-19
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper=false)
@Accessors(chain = true)
@TableName("`t_sys_menu`")
public class SysMenuModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value="`id`", type= IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    /**
     * 父菜单结点,约定：最大3级
     */
    @TableField(value = "`parent_id`")
    @ApiModelProperty(value = "父菜单结点,约定：最大3级")
    private String parentId;

    /**
     * json信息
     */
    @TableField(value = "`meta`")
    @ApiModelProperty(value = "json信息")
    private String meta;

    /**
     * 菜单名称
     */
    @TableField(value = "`name`")
    @ApiModelProperty(value = "菜单名称")
    private String name;

    /**
     * M:正常菜单,D:目录,B:按钮
     */
    @TableField(value = "`type`")
    @ApiModelProperty(value = "M:正常菜单,D:目录,B:按钮")
    private String type;

    /**
     * 路径，请使用相对根路径
     */
    @TableField(value = "`path`")
    @ApiModelProperty(value = "路径，请使用相对根路径")
    private String path;

    /**
     * vue组件地址，默认添加@/views/前缀
     */
    @TableField(value = "`component`")
    @ApiModelProperty(value = "vue组件地址，默认添加@/views/前缀")
    private String component;

    /**
     * 重定向路由
     */
    @TableField(value = "`redirect`")
    @ApiModelProperty(value = "重定向路由")
    private String redirect;

    /**
     * 权限标识名
     */
    @TableField(value = "`perm_name`")
    @ApiModelProperty(value = "权限标识名")
    private String permName;

    /**
     * 是否隐藏{YES,1,是;NO,0,否}
     */
    @TableField("`hidden`")
    @ApiModelProperty(value = "是否隐藏{YES,1,是;NO,0,否}")
    private HiddenEnum hidden;


    /**
     * 菜单排序
     */
    @TableField(value = "`sort`")
    @ApiModelProperty(value = "菜单排序")
    private Integer sort;

    /**
     * 是否是超级管理员菜单{YES,1,是;NO,0,否}
     */
    @TableField("`admin_status`")
    @ApiModelProperty(value = "是否是超级管理员菜单{YES,1,是;NO,0,否}")
    private AdminStatusEnum adminStatus;

    /**
     * 是否有效(1:有效,0:无效)
     */
    @TableField(value = "`enable`")
    @ApiModelProperty(value = "是否有效(1:有效,0:无效)")
    private Integer enable;

    /**
     * 备注
     */
    @TableField(value = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 状态
     */
    @TableField(value = "`status`")
    @ApiModelProperty(value = "状态")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonDeserialize(using = DeCustomLocalDateTimeSerializer.class)
    @JsonSerialize(using = CustomLocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    @JsonDeserialize(using = DeCustomLocalDateTimeSerializer.class)
    @JsonSerialize(using = CustomLocalDateTimeSerializer.class)
    private LocalDateTime updateTime;

    /**
     * 创建时间(时间戳)
     */
    @TableField(value = "`create_time_timestamp`", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间(时间戳)")
    private Long createTimeTimestamp;

    /**
     * 更新时间(时间戳)
     */
    @TableField(value = "`update_time_timestamp`", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间(时间戳)")
    private Long updateTimeTimestamp;


}
